package com.mach.platform.domain.iot;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;


/**
 * The persistent class for the iot_dev_type database table.
 *
 */
@Data
@NoArgsConstructor
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
@Entity
@Table(name="iot_dev_type")
@NamedQuery(name="IotDevType.findAll", query="SELECT i FROM IotDevType i")
public class IotDevType implements Serializable {

	private static final long serialVersionUID = 1L;

	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Id
	private Long id;

	private String brand;

	private String model;

	private String prol;

	@Column(name="read_interval")
	private int readInterval;

	/**
	 * 类型
	 */
	@Column(name="use_type")
	private String useType;

	@Column(name = "icon_url")
	private String iconUrl;

	@OneToMany(cascade={CascadeType.ALL},fetch=FetchType.LAZY)
	@JoinColumn(name="dev_type_id")
	private List<IotCollItem> iotCollItems;

	@Column(name = "script", columnDefinition = "TEXT")
	private String script;

	@Column(name = "script_switch", columnDefinition = "tinyint default 0")
	private int scriptSwitch;

}
